const App = getApp()
Page({
  data: {
    noticeId: "",
    noticeContent: {}
  },
  onLoad(options) {
    if (options.id) {
      this.setData({
        noticeId: options.id
      })
      this.getNotice()
    }
  },
  async getNotice() {
    let data = await App.$axios.request({
      url: `/user/noticeInfo/${this.data.noticeId}`,
      method: 'GET',
      loading: true,
    })
    if (data) {
      data.noticeContent = data.noticeContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ')
      this.setData({
        noticeContent: data
      })
    }
  }
})